Databases are used to store information for an innumerable number of applications, including various commercial, industrial, technical, scientific and educational applications. As the reliance on information increases, both the volume of information stored in most databases, as well as the number of users wishing to access that information, likewise increases. Moreover, as the volume of information in a database, and the number of users wishing to access the database, increases, the amount of computing resources required to manage such a database increases as well.
Database management systems (DBMS's), which are the computer programs that are used to access the information stored in databases, therefore often require tremendous resources to handle the heavy workloads placed on such systems. As such, significant resources have been devoted to increasing the performance of database management systems with respect to processing searches, or queries, to databases.
Improvements to both computer hardware and software have improved the capacities of conventional database management systems. For example, in the hardware realm, increases in microprocessor performance, coupled with improved memory management systems, have improved the number of queries that a particular microprocessor can perform in a given unit of time. Furthermore, the use of multiple microprocessors and/or multiple networked computers has further increased the capacities of many database management systems. From a software standpoint, the use of relational databases, which organize information into formally-defined tables consisting of rows and columns, and which are typically accessed using a standardized language such as Structured Query Language (SQL), has substantially improved processing efficiency, as well as substantially simplified the creation, organization, and extension of information within a database.
Furthermore, significant development efforts have been directed toward query “optimization,” whereby the execution of particular searches, or queries, is optimized in an automated manner to minimize the amount of resources required to execute each query. A query optimizer typically generates, for each submitted query, an access plan. In generating an access plan, a query optimizer typically creates multiple potential access plans, and selects the best among those potential access plans based upon the “cost” of each plan. The cost of each plan represents the amount of resources expected to be utilized by the plan (typically expressed in the expected amount of time to execute), and as such, selecting the plan with the lowest cost typically results in the most efficient (and quickest) execution of a query.
Despite the significant hardware, software, and optimization advances, some queries may still spend a long time executing or processing, particularly when queries are complex and/or the tables involved are large. For example, statistical imprecision during optimization may result in the selection of a suboptimal access plan and a long processing query. Queries may also spend a long time processing due to poor table configurations. For example, a poorly configured table may not have a corresponding index and/or statistic, which typically lead to shorter processing times. Thus, queries accessing poorly configured tables typically spend a longer period of time processing than queries accessing more adequately configured tables.
Additionally, other factors during the execution of a query may also increase the processing time of a query. For example, a system resource, such as CPU or I/O resource needed to process a query, may become unavailable or overloaded during the query's processing due to other tasks needing the system resource.
As a result of these and other reasons for long processing queries, a user may become impatient or may not be able to wait for a long processing query to finish executing. For example, the user may want to execute other queries, and because the long processing query may affect the performance of the other queries the user wants to execute, the user may not want to wait for the long processing query to finish processing.
Some tools do exist to improve the performance of a long processing query. However, users often do not utilize the tools because the tools may require, for example, advanced user knowledge, manual initiation of a tool, running reports, collecting database monitor records, and/or expert analysis. Particularly for a user lacking advanced knowledge, the user may have to call upon and wait for a database administrator to manually initiate a tool, re-execute the query with the tool, analyze the results, implement improvements, and re-execute the query again with the improvements. Thus, users encountering long processing queries are typically left with only two options, either to wait an additional and usually undetermined amount of time for a long processing query to finish executing, or terminate the query. Users typically choose the latter and terminate long processing queries before the processing completes.
Furthermore, upon terminating the processing of a query before the processing completes, not only did a user waste his or her time and valuable system resources waiting for the query to finish executing, but the user may still not have an answer to the query. Thus, the user typically has to process the query again, often subject to the same delays, and often with a good likelihood that the user will once again grow impatient and terminate the query. This cycle may typically be repeated many times by many users, resulting in more wasted time and unimproved queries. Additionally, other queries may be negatively affected while a long processing query is executing, also resulting in wasted time and resources.
A need therefore exists in the art for improving the performance of queries, and in particular, a more intelligent and user friendly approach to improving the processing of database queries, thus resulting in fewer early terminations of queries, improved performance, and more satisfied users.